<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 15-2-7
 * Time: 下午2:15
 * 
 */
 class download extends  MY_User_Controller{

    protected $user_id;
    public function __construct()
    {
        parent::__construct();
	}
	function index($file_id){
		
		/*下载文档*/
		$this->load->model('public/file_base');
		
		$url = $this->file_base->get_file_path($file_id);
		if(file_exists($url)){
			$this->load->model('public/file_download');  //
			$result = $this->file_download->file_download_count($file_id,$url['download_count']);
			if(!$result){
				
			}else{
				$this->_json(array('state'=>true,'tatol'=>$url['download_count']+1));
			}
		}else{
			$this->_json(array('state'=>false,'msg'=>'该文件不存在'));
		}
	}
	
 }